// "Copyright [2021] <Copyright Shengkai Lin>"

package roce;

import cluster.network_device.INic;

module EthernetNic like INic{
    parameters:
        @dataplane;
        int my_index;
        int my_global_index;
        **.localIdx = my_global_index;

    gates:
        inout out_port;
        inout gpu_port;

    submodules:
        nic_inet : EthernetNicInet {
            parameters:
                hasTcp = false;
                hasUdp = true;
                // hasRoce = false; // hasRoce in .ini file
                // numLoInterfaces = 0;
                numEthInterfaces = 1;
        }

    connections allowunconnected:

        nic_inet.ethg$o[0] --> out_port$o;
        nic_inet.ethg$i[0] <-- out_port$i;
        nic_inet.gpu_port$i <-- gpu_port$i;
        nic_inet.gpu_port$o --> gpu_port$o;
}
